package android.pot.com.smartcar.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class StartupUtils {
	
	private static final String PRODUCT_NAME="Yugoubao";
	
	
	private static final String STARTUP_INFO = "start.up."+PRODUCT_NAME;
	private static final String KEY_STARTUP_STATUS="start.up.status."+PRODUCT_NAME;
	
	public static boolean isFirstStartUp(Context context){
		SharedPreferences preferences=context.getSharedPreferences(STARTUP_INFO, Context.MODE_PRIVATE);
		boolean status=preferences.getBoolean(KEY_STARTUP_STATUS, true);
		return status;
	}
	
	public static void setFirstStartUp(Context context){
		SharedPreferences sp=context.getSharedPreferences(STARTUP_INFO,Context.MODE_PRIVATE);
		Editor ed=sp.edit();
		ed.putBoolean(KEY_STARTUP_STATUS, false);
		ed.commit();
	}
	
	public static void clearFirstStartUp(Context context){
		SharedPreferences sp=context.getSharedPreferences(STARTUP_INFO,Context.MODE_PRIVATE);
		Editor ed=sp.edit();
		ed.putBoolean(KEY_STARTUP_STATUS, true);
		ed.commit();
	}
}
